home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / startrek / trek73 / src / globals.c < prev    next >
C/C++ Source or Header  |  1995-04-11  |  6KB  |  195 lines

  1. /*
  2.  *
  3.  * TREK73: globals.c
  4.  *
  5.  * Global variable declarations
  6.  *
  7.  */
  8. #include "defines.h"
  9. #include "structs.h"
  10.  
  11. extern    int fire_phasers(), fire_tubes(), lock_phasers(), lock_tubes(),
  12.     turn_phasers(), turn_tubes(), load_tubes(), phaser_status(),
  13.     tube_status(), launch_probe(), probe_control(), pos_report(),
  14.     pos_display(), pursue(), elude(), helm(), self_scan(), scan(),
  15.     alter_power(), jettison_engineering(), detonate_engineering(),
  16.     alterpntparams(), play_dead(), corbomite_bluff(), surrender_ship(),
  17.     request_surrender(), self_destruct(), abort_self_destruct(),
  18.     survivors(), help();
  19.  
  20. extern     int
  21.     standard_strategy();
  22.  
  23.  
  24. char *statmsg[] = {
  25.     "computer inoperable",
  26.     "sensors annihilated",
  27.     "probe launcher shot off",
  28.     "warp drive disabled",
  29.     "engineering jettisoned",
  30. } ;
  31.  
  32. struct damage p_damage = {
  33.     50, 2, 20, 3, 10, 3,
  34.     1000,    "Computer destroyed.",
  35.     500,    "Sensors demolished.",
  36.     100,    "Probe launcher crushed.",
  37.     50,    "Warp drive destroyed.",
  38. } ;
  39.  
  40. struct damage a_damage = {
  41.     100, 3, 10, 2, 7, 6,
  42.     1500,    "Computer banks pierced.",
  43.     750,    "Sensors smashed.",
  44.     150,    "Probe launcher shot off.",
  45.     75,    "Warp drive disabled.",
  46. } ;
  47.  
  48.  
  49. char *baddies[MAXFOERACES][MAXBADS] = {
  50.     /* Klingons*/
  51.     "Annihilation", "Crusher", "Devastator", "Merciless", "Nemesis",
  52.     "Pitiliess", "Ruthless", "Savage", "Vengeance",
  53.     /* Romulan */
  54.     "Avenger", "Defiance", "Fearless", "Harrower", "Intrepid",
  55.     "Relentless", "Seeker", "Torch", "Vigilant",
  56.     /* Kzinti */
  57.     "Black Hole", "Comet", "Ecliptic", "Galaxy", "Meteor",
  58.     "Nova", "Pulsar", "Quasar", "Satellite",
  59.     /* Gorn */
  60.     "Chimericon", "Dragonicon", "Ornithocon", "Predatoricon", "Reptilicon",
  61.     "Serpenticon", "Tyranicon", "Vipericon", "Wyvericon",
  62.     /* Orion */
  63.     "Arrogant", "Boisterous", "Daring", "Flamboyant", "Heavensent",
  64.     "Jolly Tar", "Magnificent", "Resplendent", "Stupendous",
  65.     /* Hydran */
  66.     "Baron", "Chancellor", "Dictator", "Emperor", "Lord",
  67.     "Monarch", "President", "Shogun", "Viscount",
  68.     /* Lyran */
  69.     "Bandit", "Claw", "Dangerous", "Fury", "Mysterious",
  70.     "Sleek", "Tiger", "Vicious", "Wildcat",
  71.     /* Tholian */
  72.     "Bismark", "Centaur", "Draddock", "Forbin", "Kreiger",
  73.     "Shlurg", "Trakka", "Varnor", "Warrior",
  74.     /* Monty Python */
  75.     "Blancmange", "Spam", "R.J. Gumby", "Lumberjack", "Dennis Moore",
  76.     "Ministry of Silly Walks", "Argument Clinic", "Piranha Brothers",
  77.     "Upper Class Twit of the Year",
  78. } ;
  79.  
  80. char *feds[] = {
  81.     "Constitution", "Enterprise", "Hornet", "Lexington", "Potempkin",
  82.     "Hood", "Kongo", "Republic", "Yorktown",
  83. } ;
  84.  
  85. char *foeraces[] = {
  86.     "Klingon", "Romulan", "Kzinti", "Gorn", "Orion", "Hydran",
  87.     "Lyran", "Tholian", "Monty Python",
  88. } ;
  89.  
  90. char *foeempire[] = {
  91.     "Empire", "Star Empire", "Hegemony", "Confederation", "Pirates",
  92.     "Monarchy", "Something", "Holdfast", "Flying Circus",
  93. };
  94.  
  95. char *foeshiptype[] = {
  96.     "D-7 Battle Cruiser", "Sparrowhawk", "Strike Cruiser",
  97.     "Heavy Cruiser", "Raider Cruiser", "Ranger-class Cruiser",
  98.     "Tiger-class Cruiser", "Patrol Cruiser", "Thingee",
  99. };
  100.  
  101. char *foecaps[] = {
  102.     "Bolak", "Kang", "Koloth", "Kor", "Korax", "Krulix", "Quarlo",
  103.     "Tal", "Troblak"
  104. };
  105.  
  106. int init_p_turn[] = {
  107.     -90, 0, 0, 90
  108. };
  109.  
  110. int init_t_turn[] = {
  111.     -120, -60, 0, 0, 60, 120
  112. };
  113.  
  114. /*
  115.  * for the linked list of items in space
  116.  */
  117. struct    list head;
  118. struct    list *tail;
  119.  
  120. /*
  121.  * Global definitions
  122.  */
  123. float    segment = 0.2;        /* Segment time */
  124. float    timeperturn = 2.0;    /* Seconds per turn */
  125.  
  126. struct    ship *shiplist[10];    /* All the ships in the battle */
  127.  
  128. char    captain[30];        /* captain's name */
  129. char    science[30];        /* science officer's name */
  130. char    engineer[30];        /* engineer's name */
  131. char    com[30];        /* communications officer's name */
  132. char    nav[30];        /* navigation officer's name */
  133. char    helmsman[30];        /* helmsman's name */
  134. char    title[9];        /* captain's title */
  135. char    foerace[11];        /* enemy's race */
  136. char    foename[9];        /* enemy's captain's name */
  137. char    foestype[30];        /* enemy's ship type */
  138. char    empire[30];        /* What the enemy's empire is called */
  139. int    shipnum;        /* number of ships this time out */
  140. int    terse = 0;        /* print out initial description? */
  141. int    silly = 0;        /* Use the Monty Python's Flying Curcus? */
  142. int    defenseless = 0;    /* defensless ruse status */
  143. int    corbomite = 0;        /* corbomite bluff status */
  144. int    surrender = 0;        /* surrender offered by federation? */
  145. int    surrenderp = 0;        /* Did we request that the enemy surrenders? */
  146. char    shutup[HIGHSHUTUP];    /* Turn off messages after first printing */
  147. char    slots[300];        /* Id slots */
  148. int    global = NORMAL;    /* Situation status */
  149. char    **argp = NULL;        /* Argument list for parsit() routine */
  150. char    options[100];        /* Environment variable */
  151. char    sex[20];        /* From environment */
  152. char    shipbuf[10];        /* From environment */
  153. char    shipname[20];        /* From environment */
  154. char    racename[20];        /* From environment */
  155. int    reengaged = 0;        /* Re-engaging far-off ships? */
  156.  
  157. struct  cmd cmds[] = {
  158.     { fire_phasers,        "1",    "Fire phasers",            1 },
  159.     { fire_tubes,        "2",    "Fire photon torpedoes",    1 },
  160.     { lock_phasers,     "3",    "Lock phasers onto target",    1 },
  161.     { lock_tubes,        "4",    "Lock tubes onto target",    1 },
  162.     { turn_phasers,        "5",    "Manually rotate phasers",    1 },
  163.     { turn_tubes,        "6",    "Manually rotate tubes",    1 },
  164.     { phaser_status,    "7",    "Phaser status",        1 },
  165.     { tube_status,        "8",    "Tube status",            1 },
  166.     { load_tubes,        "9",    "Load/unload torpedo tubes",    1 },
  167.     { launch_probe,        "10",    "Launch antimatter probe",    1 },
  168.     { probe_control,    "11",    "Probe control",        1 },
  169.     { pos_report,        "12",    "Position report",        0 },
  170.     { pos_display,        "13",    "Position display",        0 },
  171.     { pursue,        "14",    "Pursue an enemy vessel",    1 },
  172.     { elude,        "15",    "Elude an enemy vessel",    1 },
  173.     { helm,            "16",    "Manually change course and speed",    1 },
  174.     { self_scan,        "17",    "Damage report",        1 },
  175.     { scan,            "18",    "Scan enemy (enemy Damage report)",    1 },
  176.     { alter_power,        "19",    "Alter power distribution",    1 },
  177.     { jettison_engineering,    "20",   "Jettison engineering",        1 },
  178.     { detonate_engineering,    "21",      "Detonate engineering",        1 },
  179.     { alterpntparams,    "22",    "Alter firing parameters",     1},
  180.     { play_dead,        "23",    "Attempt defenseless ruse",    1 },
  181.     { corbomite_bluff,    "24",    "Attempt corbomite bluff(s)",    1 },
  182.     { surrender_ship,    "25",    "Surrender",            1 },
  183.     { request_surrender,    "26",    "Ask enemy to surrender",    1 },
  184.     { self_destruct,    "27",    "Initiate self-destruct sequence",    1 },
  185.     { abort_self_destruct,    "28",    "Abort self-destruct",        1 },
  186.     { survivors,        "29",    "Survivors report",        0 },
  187.     { help,            "30",    "Reprints above list",        0 },
  188.     { NULL,            NULL,    NULL,                1 },
  189. } ;
  190.  
  191. /*    Strategy table */
  192. int (*strategies[])() = {
  193.     standard_strategy
  194. };
  195.